Skip to content

v2-GDS12: enforce database rules per user, add scenario and research - #131

Open
muyanli wants to merge 1 commit into
GenAI-Security-Project:mainfrom
muyanli:docs/gds12-user-scoped-queries
Open

muyanli wants to merge 1 commit into
GenAI-Security-Project:mainfrom
muyanli:docs/gds12-user-scoped-queries

Conversation

@muyanli

@muyanli muyanli commented Dec 3, 2026

Copy link
Copy Markdown

What this changes

GDS12 already says that generated queries run under one service account instead of the user's identity. But two controls do not fit together:

  • GDS12-T1-02 asks for row- and column-level security in the database that the gateway account cannot bypass.
  • If the database only sees the gateway account, every user gets the same view. Row-level security cannot tell users apart.
  • GDS12-T2-03 then has to check the user's access in the gateway instead.

The missing step is to pass the user's identity to the database, so its own rules apply per user. This is the same issue as delegated access in GDS02 (#130).

This PR:

  • What to do first: action 2 now says "for each user".
  • How it unfolds: one sentence under "Privilege amplification": database rules then apply to the service account, not to the user.
  • Scenarios: adds a second scenario with no attacker. An analyst for one region gets customers from every region, because the row-level policy sees only the service account.
  • Mitigations: rewrites GDS12-T1-02 to enforce row and column security against the requesting user's identity, passed from the gateway. The new check is easy to test: two users with different access get different results for the same question.
  • Incidents and research: was "None recorded in v1". Adds three studies: prompt-to-SQL injections (ICSE 2025), text-to-SQL flaws in six commercial applications, and TrojanSQL (EMNLP 2023). TrojanSQL is the text-to-SQL backdoor research that v1 mentions without a source.
  • References: replaces a personal blog post and a vendor blog with the three studies above, as the conversion notes ask.
  • Mappings: adds GDS04, because the backdoored-model case is a poisoning case.

CVEs: I checked CVE-2024-8309 and CVE-2024-7042 against their CVE records. Both match the entry, so they stay unchanged.

The entry is 1,282 words excluding references. Every section stays within its limit.

@muyanli
muyanli marked this pull request as ready for review December 3, 2026 21:01
@muyanli muyanli changed the title GDS12: enforce database rules per user, add scenario and research v2-GDS12: enforce database rules per user, add scenario and research Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant